PECs self-rating

Published

January 23, 2025

1 PEC summary

Code
plot_competency <- function(data, category) {
  data |>
    count(factor, description, rating) |>
    na.omit() |>
    group_by(description) |>
    mutate(percent = n / sum(n) * 100) |>
    ungroup() |>
    filter(factor == category) |>
    ggplot(aes(percent, description, fill = factor(rating))) +
    geom_col(size = 1, width = 0.8) +
    geom_text(
      aes(label = round(percent, 0), x = percent, y = description),
      position = position_stack(vjust = 0.5),
      color = "white") +
    scale_fill_manual(values = c("#2f3e46", "#3a5a40", "#588157", "#a3b18a", "#dad7cd"),
                      labels = c("Always", "Usually", "Sometimes", "Rarely", "Never")) +
    theme_minimal() +
    theme(plot.margin = margin(rep(20, 4)),
          plot.title = element_text(hjust = 0.5, size = 14, color = "gray20",
                                    face = "bold", margin = margin(b = 20)),
          plot.title.position = "plot",
          panel.grid = element_blank(),
          axis.title.y = element_blank(),
          axis.title.x = element_text(margin = margin(t=10), size = 14),
          axis.text = element_text(size = 12, color = "grey20"),
          strip.text = element_text(size = 12, face = "bold"),
          strip.clip = "off",
          legend.position = "right",
          legend.text = element_text(size = 12)) +
    labs(fill = element_blank(),
         title = category,
         x = "Proportion")
}
Code
# summary of each competency
p_competency_summary <- 
  competency_long_fmt_dta |> 
  count(factor, rating) |> 
  na.omit() |> 
  group_by(factor) |>
  mutate(
    percent = n / sum(n) * 100
  ) |> 
  ungroup() |>
  mutate(rating = factor(rating, levels = c(1, 2, 3, 4, 5)),
         rating = fct_rev(rating)) |>
  ggplot(aes(percent, factor, fill = factor(rating))) +
  geom_col(size = 1, width = 0.8) +
  geom_text(
    aes(label = round(percent, 0), x = percent, y = factor),
    position = position_stack(vjust = 0.5),
    color = "white") +
  # scale_fill_manual(values = c("#500207", "#9f040e", "#e30613", "#fa4c58", "#fc9ca2"),
  #                   labels = c("Always", "Usually", "Sometimes", "Rarely", "Never")) +
  scale_fill_manual(values = c("#2f3e46", "#3a5a40", "#588157", "#a3b18a", "#dad7cd"),
                    labels = c("Always", "Usually", "Sometimes", "Rarely", "Never")) +
  theme_minimal() +
  theme(plot.margin = margin(rep(20, 4)),
        plot.title = element_text(hjust = 0.5, size = 14, color = "gray20",
                                  face = "bold", margin = margin(b = 20)),
        plot.title.position = "plot",
        panel.grid = element_blank(),
        axis.title.y = element_blank(),
        axis.title.x = element_text(margin = margin(t=10), size = 14),
        axis.text = element_text(size = 12, color = "grey20"),
        strip.text = element_text(size = 12, face = "bold"),
        strip.clip = "off",
        legend.position = "right",
        legend.text = element_text(size = 12)) +
  labs(fill = element_blank(),
       x = "Proportion")

## save plot
ggsave("plot/competency_summary.jpeg", width = 10, height = 6, dpi = 300)

## display plot
knitr::include_graphics("plot/competency_summary.jpeg")

1.1 Opportunity seeking

Code
## opportunity seeking
p_opportunity_seeking <- plot_competency(competency_dta, "Opportunity seeking")

## save plot
ggsave("plot/opportunity_seeking.jpeg", width = 12, height = 4, dpi = 300)

## display plot
knitr::include_graphics("plot/opportunity_seeking.jpeg")

1.2 Persistence

Code
## persistence
p_persistence <- plot_competency(competency_dta, "Persistence")

## save plot
ggsave("plot/persistence.jpeg", width = 10, height = 4, dpi = 300)

## display plot
knitr::include_graphics("plot/persistence.jpeg")

1.3 Commitment to work contract

Code
## commitment to work contract
p_commitment <- plot_competency(competency_dta, "Commitment")

## save plot
ggsave("plot/commitment.jpeg", width = 10, height = 4, dpi = 300)

## display plot
knitr::include_graphics("plot/commitment.jpeg")

1.4 Demand for efficiency

Code
## demand for efficiency
p_efficiency <- plot_competency(competency_dta, "Demand for efficiency")

## save plot
ggsave("plot/demand_for_efficiency.jpeg", width = 10, height = 4, dpi = 300)

## display plot
knitr::include_graphics("plot/demand_for_efficiency.jpeg")

1.5 Risk taking

Code
## risk taking
p_risk_taking <- plot_competency(competency_dta, "Risk taking")

## save plot
ggsave("plot/risk_taking.jpeg", width = 10, height = 4, dpi = 300)

## display plot
knitr::include_graphics("plot/risk_taking.jpeg")

1.6 Goal setting

Code
## goal setting
p_goal_setting <- plot_competency(competency_dta, "Goal setting")

## save plot
ggsave("plot/goal_setting.jpeg", width = 10, height = 4, dpi = 300)

## display plot
knitr::include_graphics("plot/goal_setting.jpeg")

1.7 Information seeking

Code
## information seeking
p_info_seeking <- plot_competency(competency_dta, "Information seeking")

## save plot
ggsave("plot/information_seeking.jpeg", width = 10, height = 4, dpi = 300)

## display plot
knitr::include_graphics("plot/information_seeking.jpeg")

1.8 Systematic planning and monitoring

Code
## systematic planning and monitoring
p_systematic_planning <- plot_competency(competency_dta, "Systematic planning")

## save plot
ggsave("plot/systematic_planning_and_monitoring.jpeg", width = 10, height = 4, dpi = 300)

## display plot
knitr::include_graphics("plot/systematic_planning_and_monitoring.jpeg")

1.9 Persuasion and networking

Code
## persuasion and networking
p_persuasion <- plot_competency(competency_dta, "Persuasion")

## save plot
ggsave("plot/persuasion_and_networking.jpeg", width = 10, height = 4, dpi = 300)

## display plot
knitr::include_graphics("plot/persuasion_and_networking.jpeg")

1.10 Self confidence

Code
## self confidence
p_self_confidence <- plot_competency(competency_dta, "Self-confidence")

# save plot
ggsave("plot/self_confidence.jpeg", width = 10, height = 4, dpi = 300)

# display plot
knitr::include_graphics("plot/self_confidence.jpeg")